/**
 * Progetto PRAISED
 * 04/gen/2011
 */
package it.uniroma3.dia.praised.pubmed;

import it.uniroma3.dia.praised.exception.CrawlerException;
import it.uniroma3.dia.praised.pubmed.crawler.CrawlerPubMed;

/**
 * @author Accosta Augusto
 * @author Lopez Elisabetta
 *
 */
public class WorkerThread implements Runnable {

	private String url;
	private String query;
	private int threadID;
	
	/**
	 * @param string 
	 * @param urlPage 
	 * 
	 */
	public WorkerThread(String urlPage, String string, int threadID) {
		this.url = urlPage;
		this.query = string;
		this.threadID = threadID;
	}

	/* (non-Javadoc)
	 * @see java.lang.Runnable#run()
	 */
	@Override
	public void run() {
		// TODO Auto-generated method stub
		CrawlerPubMed crawler;
		try {
			System.out.println("THREAD ID " + this.threadID);
			crawler = new CrawlerPubMed(this.url, this.query);
			crawler.esegui(2);
		} catch (CrawlerException e) {
			e.printStackTrace();
		}
	}

}
